/**
 *
 */
package com.angel.data.generator.validators.impl;

import com.angel.common.helpers.ReflectionHelper;
import com.angel.data.generator.exceptions.DataGeneratorBuilderValidatorException;
import com.angel.data.generator.interfaces.DataGenerator;
import com.angel.data.generator.validators.DataGeneratorBuilderValidator;

/**
 * @author William
 *
 */
public class DataGeneratorClassInheritValidator implements DataGeneratorBuilderValidator{

	public void validate(Class<?> dataGeneratorClass) throws DataGeneratorBuilderValidatorException {
		boolean implement = ReflectionHelper.implementsInterfaceRecursive(dataGeneratorClass, DataGenerator.class);
		if(!implement){
			throw new DataGeneratorBuilderValidatorException("Data object generator class [" + dataGeneratorClass + "] isn't a [" + DataGenerator.class + "] data class type.");
		}
	}
}
